package org.jeecg.modules.fund.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.fund.entity.FundAchievement;
import org.jeecg.modules.fund.entity.FundLibrary;
import org.jeecg.modules.fund.mapper.FundAchievementMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@Api(tags = "业绩表现")
@RequestMapping("/sys/fund/achievement")
@Slf4j
public class FundAchievementController {
    @Autowired
    private FundAchievementMapper fundAchievementMapper;

    @RequestMapping(value = "/page", method = RequestMethod.GET)
    public Result<IPage<Map<String, Object>>> queryPageList(FundAchievement fundAchievement,
                                                            @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                            @RequestParam(name = "pageSize", defaultValue = "5") Integer pageSize,
                                                            HttpServletRequest req) {
        // 分页设置
        Page<FundAchievement> page = new Page<>(pageNo, pageSize);
        // 分页
        IPage<Map<String, Object>> pageList = fundAchievementMapper.selectPageVo(page, fundAchievement);
        return Result.OK(pageList);
    }
}
